home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Documentation / DirectX9 / directplay.chm / code / debug.js < prev    next >
Encoding:
Text File  |  2004-09-27  |  1.0 KB  |  56 lines

  1. <![CDATA[
  2.  
  3. /*
  4. Simple debugger object used to make it easier to examine the state of the stylesheet
  5.  
  6. Typical usage:
  7.  
  8.     goDBG.Init(); // initialize the debug object
  9.  
  10.     // add some data to it
  11.     goDBG.AddProperty("curlang", sCurLang);
  12.     goDBG.AddProperty("rids", sRIDs);
  13.     goDBG.AddProperty("activerid", sActiveRID);
  14.  
  15.     // within an XSL template, use the following to output the data
  16.     <xsl:eval>goDBG.DumpProperties();</xsl:eval>
  17.  
  18. */
  19.  
  20. function CDebugger()
  21. {
  22.     this.AddProperty = CDebugger_AddProperty;
  23.     this.Init = CDebugger_Init;
  24.     this.GetProperty = CDebugger_GetProperty;
  25.     this.DumpProperties = CDebugger_DumpProperties;
  26.  
  27.     this.Init();
  28. }
  29.  
  30. function CDebugger_AddProperty(sName, vValue)
  31. {
  32.     this._data[sName] = vValue;
  33. }
  34.  
  35. function CDebugger_Init()
  36. {
  37.     this._data = new Object();
  38. }
  39.  
  40. function CDebugger_GetProperty(sName)
  41. {
  42.     return this._data[sName];
  43. }
  44.  
  45. function CDebugger_DumpProperties()
  46. {
  47.     var sProps = "DBG: ";
  48.     for (sProp in this._data)
  49.     {
  50.         sProps += sProp + "=" + this._data[sProp] + ",";
  51.     }
  52.     return sProps;    
  53. }
  54.  
  55. ]]>
  56.